package cn.kgc.service.impl;

import cn.kgc.entity.ResumeEducation;
import cn.kgc.mapper.ResumeEducationMapper;
import cn.kgc.service.ResumeEducationService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.List;


/**
 * @author YC
 */
@Slf4j
@Service("resumeEducationService")
public class ResumeEducationServiceImpl extends ServiceImpl<ResumeEducationMapper, ResumeEducation> implements ResumeEducationService {

    @Override
    public List<ResumeEducation> queryResumeEducationByResumeId(String resumeId, String userId) {
        return baseMapper.selectList(
                new LambdaQueryWrapper<ResumeEducation>()
                        .eq(ResumeEducation::getResumeId, resumeId)
                        .eq(ResumeEducation::getUserId, userId)
                        .orderByAsc(ResumeEducation::getEndDate)
        );
    }
}
